package com.dashboard.event;

import com.dashboard.bean.ApplicationContextUtils;
import com.dashboard.event.entity.HotListSpringEventEntity;
import org.springframework.context.ApplicationEventPublisher;

/**
 * @author xuxiao
 */
public class PublishSpringEvent {

    /**
     * 发布热榜 事件 真正发送邮件是由监听器类发送
     * @param hotListSpringEventEntity 热榜数据
     */
    public static void publishHotListEvent(HotListSpringEventEntity hotListSpringEventEntity){
        ApplicationEventPublisher applicationEventPublisher = ApplicationContextUtils.getApplicationEventPublisher();
        applicationEventPublisher.publishEvent(hotListSpringEventEntity);
    }
}
